# import sys
# list1=sys.path
# for path in list1:
#     print(path)
#
import idlelib.configdialog
#除法


# a=input("请输入被除数")
# b=input("请输入除数")
# #str->int
# if a.isdigit() and b.isdigit():#如果输入a，b是纯数字，进行转换，以及后续操作
#     a=int(a)
#     b=int(b)
#     if b!=0:
#         #求商
#         c=a/b
#         print("商为：%g"%c)
#     else:
#         print("除数不能为0")
# else:
#     print("输入类型有误，请输入数字")


#异常处理  提高效率
# a=input("请输入被除数")
# b=input("请输入除数")
# try:
#     a=int(a)
#     b=int(b)
#     #求商
#     c=a/b
#     print("商为：%g"%c)
# except:
#     print("输入问题有误/除数不能为0")


#多个except的用法
# a=input("请输入被除数")
# b=input("请输入除数")
# try:
#     a=int(a)
#     b=int(b)
#     #求商
#     c=a/b
#     print("商为：%g"%c)
# except ValueError:
#     print("数据类型有误")
# except ZeroDivisionError:
#     print("除数不能为0")
# except Exception:
#     print("其他异常")



# a=input("请输入被除数")
# b=input("请输入除数")
# try:
#     a=int(a)
#     b=int(b)
#     #求商
#     c=a/b
#     print("商为：%g"%c)
# except (Exception,ValueError,ZeroDivisionError) as e:
#     print(type(e))
#     print(e.args)
#     print("遇到异常")



# try:
#     file=open("1.txt","w",encoding="utf-8")
#     file.write("Hello")
#     file.write("World")
#    #file.write([1,2.3])
#     print("写入完毕")
# except Exception as e:
#     print(e.args)
# else:
#     print("没有异常，操作成功")
# finally:
#     file.close()
#     print("关闭文件，谢谢使用")





